#   库的引用
import PyQt6.QtWidgets as QtWidgets
import PyQt6.QtGui as QtGui

#   今日窗口
class Today(QtWidgets.QFrame):
    def __init__(self):
        super().__init__()
        self.setStyleSheet("QFrame{background: white; border-radius: 6px; margin-left: 3px; margin-top: 6px; margin-right: 6px; margin-bottom: 6px}")
        self.initUI()

    def initUI(self):
        self.vbox = QtWidgets.QVBoxLayout()
        self.vbox.setContentsMargins(3, 0, 0, 3)
        self.vbox.setSpacing(3)
        self.setLayout(self.vbox)

        #   事件列表
        self.todo_List = QtWidgets.QListWidget()
        self.todo_List.setStyleSheet("QListWidget{border: 1px solid #BEBEBE;  border-radius: 6px; font: 20px; outline-style: none}"
                                     "QListWidget::item{background: #e0f0e9; border-radius: 6px; margin-top: 3px; margin-left: 3px; margin-right: 3px; height:30}"
                                     "QListWidget::item:hover{background: #c0ebd7}"
                                     "QListWidget::item:selected{background: #c0ebd7; color: black}")
        self.vbox.addWidget(self.todo_List)

        test1 = QtWidgets.QListWidgetItem("本功能尚未开发完毕")
        self.todo_List.addItem(test1)
        test2 = QtWidgets.QListWidgetItem("请等待后续更新")
        self.todo_List.addItem(test2)

        #   信息统计与控制按钮
        self.control_Widget = QtWidgets.QWidget()
        self.control_Layout = QtWidgets.QHBoxLayout()
        self.control_Layout.setContentsMargins(0, 0, 0, 0)
        self.control_Widget.setLayout(self.control_Layout)
        self.vbox.addWidget(self.control_Widget)

        self.info = QtWidgets.QLabel("今日共0项任务，已完成0项任务，进度0%")
        self.control_Layout.addWidget(self.info)
        self.control_Layout.addStretch(1)

        self.btnOK = QtWidgets.QPushButton("完成")
        self.btnOK.setIcon(QtGui.QIcon("Icon/ok.png"))
        self.control_Layout.addWidget(self.btnOK)

        self.btnNO = QtWidgets.QPushButton("放弃")
        self.btnNO.setIcon(QtGui.QIcon("Icon/no.png"))
        self.control_Layout.addWidget(self.btnNO)

        self.btnIgnore = QtWidgets.QPushButton("忽视")
        self.btnIgnore.setIcon(QtGui.QIcon("Icon/ignore.png"))
        self.control_Layout.addWidget(self.btnIgnore)